// pages/goodsEvaluate/goodsEvaluate.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    cate:0,
    info:{},
    defalut_face:('/static/defalut_face.png'),
    list: []
  },
  onLoad: function(options) {
    this.setData({
      id:options.id
    })
    this.load();
  },
  async load(){
    let res=await wx.util.post("evaluate/index",{id:this.data.id,cate:this.data.cate});
    this.setData({
      info:res.data.info,
      list:res.data.list
    })
  },
  tagTap(e){
    let s=e.currentTarget.dataset.index;
    this.setData({
      cate:s,
      list:[]
    })
    this.load();
  },
  previewImage(e) {
    let index=e.currentTarget.dataset.index;
    let current=e.currentTarget.dataset.sub;
    let imgs = this.data.list[index].worker_pj_con_images;
    let urls = imgs.map(item => {
      return item;
    })
    wx.previewImage({
      current: current,
      urls: urls
    })
  }
})